1. Field of the Invention
The present invention relates to a technique for increasing the speed of a web server, and particularly to a technique for increasing the speed of a web server that dynamically generates content.
2. Description of the Related Art
Scale-out is known as a technique for improving performance requirements of a web application server (sometimes called a web server below). Scale-out involves increasing the number of servers, and therefore has a problem of high management cost and high power consumption. Accordingly, achieving a single higher-performance web server is still a significant technical challenge. The present invention aims to increase the speed of a general environment of a web server including an HTTP server serving as a frontend and a programming language processor (called a language processor below) serving as a backend. In this configuration which allows dynamic content generation, the language processor is responsible for dynamic HTML generation, and the HTTP server is responsible for returning the generated content to a client, as an HTTP response message. In the case of the PHP language, the language processor and the HTTP server are connected to each other with Apache's mod_php on the same process, and FastCGI on different processes. FastCGI, mod_php, and the like are known as interfaces (SAPI: Server Application Programming Interface) that connect these two components.
For example, there is an approach called Faster FastCGI implemented when FastCGI is used as an SAPI (see, “lighty's lifeFaster FastCGI”, [online], Nov. 29, 2006, lighty's life, [searched on Feb. 29, 2008], Internet <URL: http://blog.lighttpd.net/articles/2006/11/29/faster-fastcgi>). In this approach, the PHP language processor writes an execution result on a file assigned in a shared memory (/dev/shm), and passes its file name as an HTTP header (X-LIGHTTPD-tempfile) in the FastCGI protocol. Then, a FastCGI module (mod_php) of the HTTP server sends a message using a sendfile system call of an operating system (OS). It is known, however, that there is overhead in costs for memory copy performed to pass content generated by the language processor to the HTTP server, which accordingly leads to low throughput.
Generally, the web application server as described above performs a series of operations: receiving a request from a client (HTTP client), generating an HTML (HyperText Markup Language) file in response to the request, and returning the generated HTML file to the client. Since the processing is performed switchingly between the HTTP server and the application executor, memory copy is performed multiple times between a user space (user memory) and a kernel space (kernel memory) in memory. In addition, for some operations of the application executor, necessary data is read from the storage, and this read data is also copied.
Such memory copy requires certain processing costs. Accordingly, repetition of redundant memory copy lowers the overall performance of the web application server. The present invention aims to solve the above problem and to improve the operation performance of the web application server by reducing the processing costs of memory copy.